package xyz.scootaloo.mono.admin.web.auth

import org.springframework.beans.factory.annotation.Autowired
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RestController
import xyz.scootaloo.mono.admin.dto.MenuItemVO
import xyz.scootaloo.mono.admin.service.UIService
import xyz.scootaloo.mono.base.lang.R

/**
 * 菜单管理
 *
 * - 获取当前用户的菜单 [getUserMenu]
 *
 * @author flutterdash@qq.com
 * @since 2021/9/10 13:24
 */
@RestController
@RequestMapping("/admin/menu")
class MenuAdminController {

    @Autowired lateinit var uiService: UIService

    @GetMapping("/")
    fun getUserMenu(): R<List<MenuItemVO>> =
        R.tryAndGet { uiService.getUserMenu() }

}
